import { createSSRApp } from "vue";
import App from "./App.vue";
import * as Pinia from 'pinia';
import { createUnistorage } from "pinia-plugin-unistorage";
import { requestInterceptor } from "./utils/request/requestInterceptors";

export function createApp() {
  const app = createSSRApp(App);
  const store = Pinia.createPinia();

  // 关键代码 👇
  store.use(createUnistorage());
  app.use(store)
  app.use(requestInterceptor)

  // 引入请求封装
	// Request()

  return {
    app,
    Pinia, // 此处必须将 Pinia 返回
  };
}
